<% task.ancestors.reverse.each { |t| %>
<ul style="padding-left:20px;">
<li><img src="/images/collapse.gif"> <%= t.title %></li>
<% } %>   
<ul style="padding-left:20px;">
<h4 style="margin:0;">

<% if task.project_id!=0%>
<%=task.project.name %>:
<% end %>

<%
 if(task.star==1); starstr = "on"; else; starstr='off'; end
-%>

<a href="#" onclick="star_it(<%=task.id%>);return false;"><img src="/images/star_<%=starstr%>_2.gif" id="st<%=task.id%>" title="special"></a>

<%= task.title%>

</h4>
</ul>
<% task.ancestors.each { |t| %>
</ul>
<% } %>   

<% if task.has_subtasks %>
<%= pluralize(task.subtasks_count, "child")%>
<ul style="margin:0 0 10px 0;padding-left:20px;">
<% task.subtasks.sort_by{|t| t.state}.each { |t| %>
<li>- <%= t.state%>: <%= t.title[0..100] %><% if t.title.size>100 %> [...]<%end%></li>
<% } %>   
</ul>

<% end %>


<%= render(:partial => 'state', :locals => {:task=>task}) %><br/>

<%= link_to_function('Edit task',"$('edit').show();", {:class=>'btnlnk'})%>
<ul id="edit" style="display:none;">
<%= render(:partial=>'task/task', :locals=>{:task=>task, :tasks=>nil, :item_name=>'t', :is_my_task=>true})%>
</ul>

<br/>
<br/>

<%= link_to_remote('Skip this task, go to next',{:url=>{:action=>'skip'}, :update=>'task'}, {:class=>'btnlnk'})%>

<%= count %> tasks remaining...<br/>

